export function Object2Blob(object:Object, type:string):Blob{
    const json = JSON.stringify(object)
    return Json2Blob(json, type)
}

export function Json2Blob(json:string, type:string):Blob{
    return new Blob([json], {type: type})
}

export function Blob2Base64(blob:Blob, callback:Function) {
    const fileReader = new FileReader();
    fileReader.onload = (e) => {
        callback(e.target?.result)
    }
    fileReader.readAsDataURL(blob)
}
